﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyCpuMonitor.Classes
{
    public static class ProcessorDataLookUp
    {
        public static string Architecture(string code)
        {
            string s;
            switch (code)
            {
                case "0":
                    s = "x86";
                    break;
                case "1":
                    s = "MIPS";
                    break;
                case "2":
                    s = "Alpha";
                    break;
                case "3":
                    s = "PowerPC";
                    break;
                case "6":
                    s = "Intel Itanium Processor Family (IPF)";
                    break;
                case "9":
                    s = "x64";
                    break;
                default:
                    s = "Unable to Determine";
                    break;
            }
            return s;
        }

        public static string Availability(string code)
        {
            string s;
            switch (code)
            {
                case "1":
                    s = "Other";
                    break;
                case "2":
                    s = "Unknown";
                    break;
                case "3":
                    s = "Running or Full Power";
                    break;
                case "4":
                    s = "Warning";
                    break;
                case "5":
                    s = "In Test";
                    break;
                case "6":
                    s = "Not Applicable";
                    break;
                case "7":
                    s = "Power Off";
                    break;
                case "8":
                    s = "Off Line";
                    break;
                case "9":
                    s = "Off Duty";
                    break;
                case "10":
                    s = "Degraded";
                    break;
                case "11":
                    s = "Not Installed";
                    break;
                case "12":
                    s = "Install Error";
                    break;
                case "13":
                    s = "Power Save - Unknown. The device is known to be in a power save state, but its exact status is unknown.";
                    break;
                case "14":
                    s = "Power Save - Low Power Mode. The device is in a power save state, but is still functioning, and may exhibit decreased performance.";
                    break;
                case "15":
                    s = "Power Save - Standby. The device is not functioning, but can be brought to full power quickly.";
                    break;
                case "16":
                    s = " Power Cycle";
                    break;
                case "17":
                    s = " Power Save - Warning. The device is in a warning state, though also in a power save state.";
                    break;
                default:
                    s = "Unable to Determine";
                    break;
            }
            return s;
        }

        public static string ConfigManagerErrorCode(string code)
        {
            string s;
            switch (code)
            {
                case "0":
                    s = "Device is working properly.";
                    break;
                case "1":
                    s = "Device is not configured correctly.";
                    break;
                case "2":
                    s = "Windows cannot load the driver for this device.";
                    break;
                case "3":
                    s = "Driver for this device might be corrupted or the system may be low on memory or other resources.";
                    break;
                case "4":
                    s = "Device is not working properly. One of its drivers or the registry might be corrupted.";
                    break;
                case "5":
                    s = "Driver for the device requires a resource that Windows cannot manage.";
                    break;
                case "6":
                    s = "Boot configuration for the device conflicts with other devices.";
                    break;
                case "7":
                    s = "Cannot filter.";
                    break;
                case "8":
                    s = "Driver loader for the device is missing.";
                    break;
                case "9":
                    s = "Device is not working properly. The controlling firmware is incorrectly reporting the resources for the device.";
                    break;
                case "10":
                    s = "Device cannot start.";
                    break;
                case "11":
                    s = "Device failed.";
                    break;
                case "12":
                    s = "Device cannot find enough free resources to use.";
                    break;
                case "13":
                    s = "Windows cannot verify the device's resources.";
                    break;
                case "14":
                    s = "Device cannot work properly until the computer is restarted.";
                    break;
                case "15":
                    s = "Device is not working properly due to a possible re-enumeration problem.";
                    break;
                case "16":
                    s = "Windows cannot identify all of the resources that the device uses.";
                    break;
                case "17":
                    s = "Device is requesting an unknown resource type.";
                    break;
                case "18":
                    s = "Device drivers must be reinstalled.";
                    break;
                case "19":
                    s = "Failure using the VxD loader.";
                    break;
                case "20":
                    s = "Registry might be corrupted.";
                    break;
                case "21":
                    s = "System failure. If changing the device driver is ineffective, see the hardware documentation. Windows is removing the device.";
                    break;
                case "22":
                    s = "Device is disabled.";
                    break;
                case "23":
                    s = "System failure. If changing the device driver is ineffective, see the hardware documentation.";
                    break;
                case "24":
                    s = "Device is not present, not working properly, or does not have all of its drivers installed.";
                    break;
                case "25":
                    s = "Windows is still setting up the device.";
                    break;
                case "26":
                    s = "Windows is still setting up the device.";
                    break;
                case "27":
                    s = "Device does not have valid log configuration.";
                    break;
                case "28":
                    s = "Device drivers are not installed.";
                    break;
                case "29":
                    s = "Device is disabled. The device firmware did not provide the required resources.";
                    break;
                case "30":
                    s = "Device is using an IRQ resource that another device is using.";
                    break;
                case "31":
                    s = "Device is not working properly. Windows cannot load the required device drivers. ";
                    break;
                default:
                    s = "Unable to Determine";
                    break;
            }
            return s;
        }


        public static string CpuStatus(string code)
        {
            string s;
            switch (code)
            {
                case "0":
                    s = "Unknown";
                    break;
                case "1":
                    s = "CPU Enabled";
                    break;
                case "2":
                    s = "CPU Disabled by User via BIOS Setup";
                    break;
                case "3":
                    s = "CPU Disabled by BIOS (POST Error)";
                    break;
                case "4":
                    s = "CPU Is Idle";
                    break;
                case "5":
                    s = "Reserved";
                    break;
                case "6":
                    s = "Reserved";
                    break;
                case "7":
                    s = "Other";
                    break;
                default:
                    s = "Unable to Determine";
                    break;
            }
            return s;
        }

        public static string Family(string code)
        {
            string s;
            switch (code)
            {
                case "1":
                    s = "Other";
                    break;
                case "2":
                    s = "Unknown";
                    break;
                case "3":
                    s = "8086";
                    break;
                case "4":
                    s = "80286";
                    break;
                case "5":
                    s = "Intel386™ Processor";
                    break;
                case "6":
                    s = "Intel486™ Processor";
                    break;
                case "7":
                    s = "8087";
                    break;
                case "8":
                    s = "80287";
                    break;
                case "9":
                    s = "80387";
                    break;
                case "10":
                    s = "80487";
                    break;
                case "11":
                    s = "Pentium Brand";
                    break;
                case "12":
                    s = "Pentium Pro";
                    break;
                case "13":
                    s = "Pentium II";
                    break;
                case "14":
                    s = "Pentium Processor with MMX™ Technology";
                    break;
                case "15":
                    s = "Celeron™";
                    break;
                case "16":
                    s = "Pentium II Xeon™";
                    break;
                case "17":
                    s = "Pentium III";
                    break;
                case "18":
                    s = "M1 Family";
                    break;
                case "19":
                    s = "M2 Family";
                    break;
                case "24":
                    s = "AMD Duron™ Processor Family";
                    break;
                case "25":
                    s = "K5 Family";
                    break;
                case "26":
                    s = "K6 Family";
                    break;
                case "27":
                    s = "K6-2";
                    break;
                case "28":
                    s = "K6-3";
                    break;
                case "29":
                    s = "AMD Athlon™ Processor Family";
                    break;
                case "30":
                    s = "AMD2900 Family";
                    break;
                case "31":
                    s = "K6-2+";
                    break;
                case "32":
                    s = "Power PC Family";
                    break;
                case "33":
                    s = "Power PC 601";
                    break;
                case "34":
                    s = "Power PC 603";
                    break;
                case "35":
                    s = "Power PC 603+";
                    break;
                case "36":
                    s = "Power PC 604";
                    break;
                case "37":
                    s = "Power PC 620";
                    break;
                case "38":
                    s = "Power PC X704";
                    break;
                case "39":
                    s = "Power PC 750";
                    break;
                case "48":
                    s = "Alpha Family";
                    break;
                case "49":
                    s = "Alpha 21064";
                    break;
                case "50":
                    s = "Alpha 21066";
                    break;
                case "51":
                    s = "Alpha 21164";
                    break;
                case "52":
                    s = "Alpha 21164PC";
                    break;
                case "53":
                    s = "Alpha 21164a";
                    break;
                case "54":
                    s = "Alpha 21264";
                    break;
                case "55":
                    s = "Alpha 21364";
                    break;
                case "64":
                    s = "MIPS Family";
                    break;
                case "65":
                    s = "MIPS R4000";
                    break;
                case "66":
                    s = "MIPS R4200";
                    break;
                case "67":
                    s = "MIPS R4400";
                    break;
                case "68":
                    s = "MIPS R4600";
                    break;
                case "69":
                    s = "MIPS R10000";
                    break;
                case "80":
                    s = "SPARC Family";
                    break;
                case "81":
                    s = "SuperSPARC";
                    break;
                case "82":
                    s = "microSPARC II";
                    break;
                case "83":
                    s = "microSPARC IIep";
                    break;
                case "84":
                    s = "UltraSPARC";
                    break;
                case "85":
                    s = "UltraSPARC II";
                    break;
                case "86":
                    s = "UltraSPARC IIi";
                    break;
                case "87":
                    s = "UltraSPARC III";
                    break;
                case "88":
                    s = "UltraSPARC IIIi";
                    break;
                case "96":
                    s = "68040";
                    break;
                case "97":
                    s = "68xxx Family";
                    break;
                case "98":
                    s = "68000";
                    break;
                case "99":
                    s = "68010";
                    break;
                case "100":
                    s = "68020";
                    break;
                case "101":
                    s = "68030";
                    break;
                case "112":
                    s = "Hobbit Family";
                    break;
                case "120":
                    s = "Crusoe™ TM5000 Family";
                    break;
                case "121":
                    s = "Crusoe™ TM3000 Family";
                    break;
                case "122":
                    s = "Efficeon™ TM8000 Family";
                    break;
                case "128":
                    s = "Weitek";
                    break;
                case "130":
                    s = "Itanium™ Processor";
                    break;
                case "131":
                    s = "AMD Athlon™ 64 Processor Famiily";
                    break;
                case "132":
                    s = "AMD Opteron™ Processor Family";
                    break;
                case "144":
                    s = "PA-RISC Family";
                    break;
                case "145":
                    s = "PA-RISC 8500";
                    break;
                case "146":
                    s = "PA-RISC 8000";
                    break;
                case "147":
                    s = "PA-RISC 7300LC";
                    break;
                case "148":
                    s = "PA-RISC 7200";
                    break;
                case "149":
                    s = "PA-RISC 7100LC";
                    break;
                case "150":
                    s = "PA-RISC 7100";
                    break;
                case "160":
                    s = "V30 Family";
                    break;
                case "176":
                    s = "Pentium III Xeon™ Processor";
                    break;
                case "177":
                    s = "Pentium III Processor with Intel SpeedStep™ Technology";
                    break;
                case "178":
                    s = "Pentium 4";
                    break;
                case "179":
                    s = "Intel Xeon™";
                    break;
                case "180":
                    s = "AS400 Family";
                    break;
                case "181":
                    s = "Intel Xeon™ Processor MP";
                    break;
                case "182":
                    s = "AMD Athlon™ XP Family";
                    break;
                case "183":
                    s = "AMD Athlon™ MP Family";
                    break;
                case "184":
                    s = "Intel Itanium 2";
                    break;
                case "185":
                    s = "Intel Pentium M Processor";
                    break;
                case "190":
                    s = "K7";
                    break;
                case "200":
                    s = "IBM390 Family";
                    break;
                case "201":
                    s = "G4";
                    break;
                case "202":
                    s = "G5";
                    break;
                case "203":
                    s = "G6";
                    break;
                case "204":
                    s = "z/Architecture Base";
                    break;
                case "250":
                    s = "i860";
                    break;
                case "251":
                    s = "i960";
                    break;
                case "260":
                    s = "SH-3";
                    break;
                case "261":
                    s = "SH-4";
                    break;
                case "280":
                    s = "ARM";
                    break;
                case "281":
                    s = "StrongARM";
                    break;
                case "300":
                    s = "6x86";
                    break;
                case "301":
                    s = "MediaGX";
                    break;
                case "302":
                    s = "MII";
                    break;
                case "320":
                    s = "WinChip";
                    break;
                case "350":
                    s = "DSP";
                    break;
                case "500":
                    s = "Video Processor";
                    break;
                default:
                    s = "Unable to Determine";
                    break;
            }
            return s;
        }

        public static string PowerManagementCapabilities(string code)
        {
            string s;
            switch (code)
            {
                case "0":
                    s = "Unknown";
                    break;
                case "1":
                    s = "Not Supported";
                    break;
                case "2":
                    s = "Disabled";
                    break;
                case "3":
                    s = "Enabled. The power management features are currently enabled but the exact feature set is unknown or the information is unavailable.";
                    break;
                case "4":
                    s = "Power Saving Modes Entered Automatically. The device can change its power state based on usage or other criteria.";
                    break;
                case "5":
                    s = "Power State Settable. The SetPowerState method is supported. This method is found on the parent CIM_LogicalDevice class and can be implemented. For more information, see Designing Managed Object Format (MOF) Classes.";
                    break;
                case "6":
                    s = "Power Cycling Supported. The SetPowerState method can be invoked with the PowerState parameter set to 5 (Power Cycle).";
                    break;
                case "7":
                    s = "Timed Power-On Supported. The SetPowerState method can be invoked with the PowerState parameter set to 5 (Power Cycle) and Time set to a specific date and time, or interval, for power-on.";
                    break;
                default:
                    s = "Unable to Determine";
                    break;
            }
            return s;
        }

        public static string ProcessorType(string code)
        {
            string s;
            switch (code)
            {
                case "1":
                    s = "Other";
                    break;
                case "2":
                    s = "Unknown";
                    break;
                case "3":
                    s = "Central Processor";
                    break;
                case "4":
                    s = "Math Processor";
                    break;
                case "5":
                    s = "DSP Processor";
                    break;
                case "6":
                    s = "Video Processor";
                    break;
                default:
                    s = "Unable to Determine";
                    break;
            }
            return s;
        }

        public static string StatusInfo(string code)
        {
            string s;
            switch (code)
            {
                case "1":
                    s = "Other";
                    break;
                case "2":
                    s = "Unknown";
                    break;
                case "3":
                    s = "Enabled";
                    break;
                case "4":
                    s = "Disabled";
                    break;
                case "5":
                    s = "Not Applicable";
                    break;
                default:
                    s = "Unable to Determine";
                    break;
            }
            return s;
        }

        public static string UpgradeMethod(string code)
        {
            string s;
            switch (code)
            {
                case "1":
                    s = "Other";
                    break;
                case "2":
                    s = "Unknown";
                    break;
                case "3":
                    s = "Daughter Board";
                    break;
                case "4":
                    s = "ZIF Socket";
                    break;
                case "5":
                    s = "Replacement or Piggy Back";
                    break;
                case "6":
                    s = "None";
                    break;
                case "7":
                    s = "LIF Socket";
                    break;
                case "8":
                    s = "Slot 1";
                    break;
                case "9":
                    s = "Slot 2";
                    break;
                case "10":
                    s = "370 Pin Socket";
                    break;
                case "11":
                    s = "Slot A";
                    break;
                case "12":
                    s = "Slot M";
                    break;
                case "13":
                    s = "Socket 423";
                    break;
                case "14":
                    s = "Socket A (Socket 462)";
                    break;
                case "15":
                    s = "Socket 478";
                    break;
                case "16":
                    s = "Socket 754";
                    break;
                case "17":
                    s = "Socket 940";
                    break;
                case "18":
                    s = "Socket 939";
                    break;
                default:
                    s = "Unable to Determine";
                    break;
            }
            return s;
        }

        public static string VoltageCaps(string code)
        {
            string s;
            switch (code)
            {
                case "1":
                    s = "5 volts";
                    break;
                case "2":
                    s = "3.3 volts";
                    break;
                case "4":
                    s = "2.9 volts";
                    break;
                default:
                    s = "Unable to Determine";
                    break;
            }
            return s;
        }


    }
}
